<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>微信支付页</title>
</head>

<body>
	<div id="qrcode"></div>
</body>
<script src="./../js/qrcode.min.js" ></script>
<script src="../js/jquery.min.js"></script>
<script type="text/javascript" >

    function getQueryVariable(variable)
    {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("$");

            if(pair[0] == variable){return pair[1];}
        }
        return(false);
    }

    let qrcode = new QRCode(document.getElementById("qrcode"), {
        width : 240,
        height : 240,
        correctLevel: QRCode.CorrectLevel.H  //容错级别
    });
    //此处就是二维码的信息

    qrcode.makeCode(getQueryVariable("code_url"));
    returnNotify();

    function returnNotify(){
        //循环发送请求  每2S中执行一次代码
        setInterval(function () {
            $.ajax({
                url:"/order/findStatusById?orderId="+getQueryVariable("orderId"),
                method:'get',
                success:function (result) {
                    if(result.code == 1){
                        location.href="/front/page/pay-success.html";
                    }
                }
            })
        },2000);
    }
</script>




</html>